{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 加载数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pandas import DataFrame\n",
    "from pandas import concat\n",
    "\n",
    "def series_to_supervised(data, n_in=1, n_out=1, dropnan=True):\n",
    "\t\"\"\"\n",
    "\tFrame a time series as a supervised learning dataset.\n",
    "\tArguments:\n",
    "\t\tdata: Sequence of observations as a list or NumPy array.\n",
    "\t\tn_in: Number of lag observations as input (X).\n",
    "\t\tn_out: Number of observations as output (y).\n",
    "\t\tdropnan: Boolean whether or not to drop rows with NaN values.\n",
    "\tReturns:\n",
    "\t\tPandas DataFrame of series framed for supervised learning.\n",
    "\t\"\"\"\n",
    "\tn_vars = 1 if type(data) is list else data.shape[1]\n",
    "\tdf = DataFrame(data)\n",
    "\tcols, names = list(), list()\n",
    "\t# input sequence (t-n, ... t-1)\n",
    "\tfor i in range(n_in, 0, -1):\n",
    "\t\tcols.append(df.shift(i))\n",
    "\t\tnames += [('var%d(t-%d)' % (j+1, i)) for j in range(n_vars)]\n",
    "\t# forecast sequence (t, t+1, ... t+n)\n",
    "\tfor i in range(0, n_out):\n",
    "\t\tcols.append(df.shift(-i))\n",
    "\t\tif i == 0:\n",
    "\t\t\tnames += [('var%d(t)' % (j+1)) for j in range(n_vars)]\n",
    "\t\telse:\n",
    "\t\t\tnames += [('var%d(t+%d)' % (j+1, i)) for j in range(n_vars)]\n",
    "\t# put it all together\n",
    "\tagg = concat(cols, axis=1)\n",
    "\tagg.columns = names\n",
    "\t# drop rows with NaN values\n",
    "\tif dropnan:\n",
    "\t\tagg.dropna(inplace=True)\n",
    "\treturn agg"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n",
      "   var1(t-4)  var1(t-3)  var1(t-2)  var1(t-1)  var1(t)\n",
      "4        0.0        1.0        2.0        3.0        4\n",
      "5        1.0        2.0        3.0        4.0        5\n",
      "6        2.0        3.0        4.0        5.0        6\n",
      "7        3.0        4.0        5.0        6.0        7\n",
      "8        4.0        5.0        6.0        7.0        8\n",
      "9        5.0        6.0        7.0        8.0        9\n",
      "<class 'pandas.core.frame.DataFrame'>\n",
      "(6, 5)\n"
     ]
    }
   ],
   "source": [
    "values = [x for x in range(10)]\n",
    "print(values)\n",
    "data = series_to_supervised(values, 4, 1)\n",
    "print(data)\n",
    "print(type(data))\n",
    "print(data.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   var1(t-4)  var1(t-3)  var1(t-2)  var1(t-1)\n",
      "4        0.0        1.0        2.0        3.0\n",
      "5        1.0        2.0        3.0        4.0\n",
      "6        2.0        3.0        4.0        5.0\n",
      "7        3.0        4.0        5.0        6.0\n",
      "8        4.0        5.0        6.0        7.0\n",
      "9        5.0        6.0        7.0        8.0\n",
      "=============================\n",
      "4    4\n",
      "5    5\n",
      "6    6\n",
      "7    7\n",
      "8    8\n",
      "9    9\n",
      "Name: var1(t), dtype: int64\n",
      "[[[0.]\n",
      "  [1.]\n",
      "  [2.]\n",
      "  [3.]]\n",
      "\n",
      " [[1.]\n",
      "  [2.]\n",
      "  [3.]\n",
      "  [4.]]\n",
      "\n",
      " [[2.]\n",
      "  [3.]\n",
      "  [4.]\n",
      "  [5.]]\n",
      "\n",
      " [[3.]\n",
      "  [4.]\n",
      "  [5.]\n",
      "  [6.]]\n",
      "\n",
      " [[4.]\n",
      "  [5.]\n",
      "  [6.]\n",
      "  [7.]]\n",
      "\n",
      " [[5.]\n",
      "  [6.]\n",
      "  [7.]\n",
      "  [8.]]]\n",
      "(6, 4, 1)\n"
     ]
    }
   ],
   "source": [
    "'''\n",
    "处理数据\n",
    "'''\n",
    "train_x = data.iloc[:,:-1]#除了最后一列不要,代码还可以更加完善可读性高\n",
    "train_y = data.iloc[:,-1]\n",
    "print(train_x)\n",
    "print(\"=============================\")\n",
    "print(train_y)\n",
    "train_x = train_x.values#values才能reshape，否则AttributeError: 'DataFrame' object has no attribute 'reshape'\n",
    "# train_x = train_x.reshape((train_x.shape[0], 1, train_x.shape[1]))#[hang,1,column]适合一个时间步多个变量也就是多个feature的打法\n",
    "train_x = train_x.reshape(train_x.shape[0], train_x.shape[1], 1)#适合多个时间步单个变量也就是单个feature的打法\n",
    "# train_y = train_x.reshape((train_x.shape[0], 1, train_x.shape[1]))\n",
    "\n",
    "print(train_x)\n",
    "print(train_x.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n",
      "C:\\Users\\forwhat\\anaconda3\\envs\\pytorch-gpu\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n",
      "C:\\Users\\forwhat\\anaconda3\\envs\\pytorch-gpu\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n",
      "C:\\Users\\forwhat\\anaconda3\\envs\\pytorch-gpu\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n",
      "C:\\Users\\forwhat\\anaconda3\\envs\\pytorch-gpu\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n",
      "C:\\Users\\forwhat\\anaconda3\\envs\\pytorch-gpu\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n",
      "C:\\Users\\forwhat\\anaconda3\\envs\\pytorch-gpu\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n"
     ]
    }
   ],
   "source": [
    "import numpy\n",
    "import matplotlib.pyplot as plt\n",
    "from keras.models import Sequential\n",
    "from keras.layers import Dense\n",
    "from keras.layers import LSTM\n",
    "import  pandas as pd\n",
    "import  os\n",
    "from keras.models import Sequential, load_model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def mkdir(path):\n",
    "    # 引入模块\n",
    "    import os\n",
    " \n",
    "    # 去除首位空格\n",
    "    path=path.strip()\n",
    "    # 去除尾部 \\ 符号\n",
    "    path=path.rstrip(\"\\\\\")\n",
    " \n",
    "    # 判断路径是否存在\n",
    "    # 存在     True\n",
    "    # 不存在   False\n",
    "    isExists=os.path.exists(path)\n",
    " \n",
    "    # 判断结果\n",
    "    if not isExists:\n",
    "        # 如果不存在则创建目录\n",
    "        # 创建目录操作函数\n",
    "        os.makedirs(path) \n",
    " \n",
    "        print (path+' 创建成功')\n",
    "        return True\n",
    "    else:\n",
    "        # 如果目录存在则不创建，并提示目录已存在\n",
    "        print (path+' 目录已存在')\n",
    "        return False\n",
    " "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\forwhat\\anaconda3\\envs\\pytorch-gpu\\lib\\site-packages\\tensorflow\\python\\framework\\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "WARNING:tensorflow:From C:\\Users\\forwhat\\anaconda3\\envs\\pytorch-gpu\\lib\\site-packages\\tensorflow\\python\\ops\\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "Epoch 1/100\n",
      " - 0s - loss: 41.7396\n",
      "Epoch 2/100\n",
      " - 0s - loss: 38.8195\n",
      "Epoch 3/100\n",
      " - 0s - loss: 36.0723\n",
      "Epoch 4/100\n",
      " - 0s - loss: 33.2207\n",
      "Epoch 5/100\n",
      " - 0s - loss: 30.4850\n",
      "Epoch 6/100\n",
      " - 0s - loss: 27.7985\n",
      "Epoch 7/100\n",
      " - 0s - loss: 24.9621\n",
      "Epoch 8/100\n",
      " - 0s - loss: 22.3523\n",
      "Epoch 9/100\n",
      " - 0s - loss: 19.4899\n",
      "Epoch 10/100\n",
      " - 0s - loss: 16.7530\n",
      "Epoch 11/100\n",
      " - 0s - loss: 14.0242\n",
      "Epoch 12/100\n",
      " - 0s - loss: 11.7006\n",
      "Epoch 13/100\n",
      " - 0s - loss: 9.4624\n",
      "Epoch 14/100\n",
      " - 0s - loss: 7.4719\n",
      "Epoch 15/100\n",
      " - 0s - loss: 5.4919\n",
      "Epoch 16/100\n",
      " - 0s - loss: 4.3229\n",
      "Epoch 17/100\n",
      " - 0s - loss: 3.2170\n",
      "Epoch 18/100\n",
      " - 0s - loss: 2.3864\n",
      "Epoch 19/100\n",
      " - 0s - loss: 1.9402\n",
      "Epoch 20/100\n",
      " - 0s - loss: 1.5753\n",
      "Epoch 21/100\n",
      " - 0s - loss: 1.2059\n",
      "Epoch 22/100\n",
      " - 0s - loss: 1.0832\n",
      "Epoch 23/100\n",
      " - 0s - loss: 1.0372\n",
      "Epoch 24/100\n",
      " - 0s - loss: 0.9914\n",
      "Epoch 25/100\n",
      " - 0s - loss: 0.8782\n",
      "Epoch 26/100\n",
      " - 0s - loss: 0.8381\n",
      "Epoch 27/100\n",
      " - 0s - loss: 0.8282\n",
      "Epoch 28/100\n",
      " - 0s - loss: 0.7892\n",
      "Epoch 29/100\n",
      " - 0s - loss: 0.7504\n",
      "Epoch 30/100\n",
      " - 0s - loss: 0.7175\n",
      "Epoch 31/100\n",
      " - 0s - loss: 0.6833\n",
      "Epoch 32/100\n",
      " - 0s - loss: 0.6629\n",
      "Epoch 33/100\n",
      " - 0s - loss: 0.6272\n",
      "Epoch 34/100\n",
      " - 0s - loss: 0.6095\n",
      "Epoch 35/100\n",
      " - 0s - loss: 0.5860\n",
      "Epoch 36/100\n",
      " - 0s - loss: 0.5587\n",
      "Epoch 37/100\n",
      " - 0s - loss: 0.5326\n",
      "Epoch 38/100\n",
      " - 0s - loss: 0.5211\n",
      "Epoch 39/100\n",
      " - 0s - loss: 0.4902\n",
      "Epoch 40/100\n",
      " - 0s - loss: 0.4746\n",
      "Epoch 41/100\n",
      " - 0s - loss: 0.4578\n",
      "Epoch 42/100\n",
      " - 0s - loss: 0.4368\n",
      "Epoch 43/100\n",
      " - 0s - loss: 0.4225\n",
      "Epoch 44/100\n",
      " - 0s - loss: 0.4099\n",
      "Epoch 45/100\n",
      " - 0s - loss: 0.3891\n",
      "Epoch 46/100\n",
      " - 0s - loss: 0.3801\n",
      "Epoch 47/100\n",
      " - 0s - loss: 0.3694\n",
      "Epoch 48/100\n",
      " - 0s - loss: 0.3522\n",
      "Epoch 49/100\n",
      " - 0s - loss: 0.3434\n",
      "Epoch 50/100\n",
      " - 0s - loss: 0.3350\n",
      "Epoch 51/100\n",
      " - 0s - loss: 0.3234\n",
      "Epoch 52/100\n",
      " - 0s - loss: 0.3113\n",
      "Epoch 53/100\n",
      " - 0s - loss: 0.3023\n",
      "Epoch 54/100\n",
      " - 0s - loss: 0.2893\n",
      "Epoch 55/100\n",
      " - 0s - loss: 0.2787\n",
      "Epoch 56/100\n",
      " - 0s - loss: 0.2818\n",
      "Epoch 57/100\n",
      " - 0s - loss: 0.2733\n",
      "Epoch 58/100\n",
      " - 0s - loss: 0.2562\n",
      "Epoch 59/100\n",
      " - 0s - loss: 0.2509\n",
      "Epoch 60/100\n",
      " - 0s - loss: 0.2395\n",
      "Epoch 61/100\n",
      " - 0s - loss: 0.2432\n",
      "Epoch 62/100\n",
      " - 0s - loss: 0.2303\n",
      "Epoch 63/100\n",
      " - 0s - loss: 0.2213\n",
      "Epoch 64/100\n",
      " - 0s - loss: 0.2155\n",
      "Epoch 65/100\n",
      " - 0s - loss: 0.2091\n",
      "Epoch 66/100\n",
      " - 0s - loss: 0.2035\n",
      "Epoch 67/100\n",
      " - 0s - loss: 0.1977\n",
      "Epoch 68/100\n",
      " - 0s - loss: 0.1895\n",
      "Epoch 69/100\n",
      " - 0s - loss: 0.1863\n",
      "Epoch 70/100\n",
      " - 0s - loss: 0.1845\n",
      "Epoch 71/100\n",
      " - 0s - loss: 0.1802\n",
      "Epoch 72/100\n",
      " - 0s - loss: 0.1741\n",
      "Epoch 73/100\n",
      " - 0s - loss: 0.1728\n",
      "Epoch 74/100\n",
      " - 0s - loss: 0.1679\n",
      "Epoch 75/100\n",
      " - 0s - loss: 0.1650\n",
      "Epoch 76/100\n",
      " - 0s - loss: 0.1692\n",
      "Epoch 77/100\n",
      " - 0s - loss: 0.1582\n",
      "Epoch 78/100\n",
      " - 0s - loss: 0.1536\n",
      "Epoch 79/100\n",
      " - 0s - loss: 0.1522\n",
      "Epoch 80/100\n",
      " - 0s - loss: 0.1634\n",
      "Epoch 81/100\n",
      " - 0s - loss: 0.1597\n",
      "Epoch 82/100\n",
      " - 0s - loss: 0.1461\n",
      "Epoch 83/100\n",
      " - 0s - loss: 0.1497\n",
      "Epoch 84/100\n",
      " - 0s - loss: 0.1390\n",
      "Epoch 85/100\n",
      " - 0s - loss: 0.1487\n",
      "Epoch 86/100\n",
      " - 0s - loss: 0.1405\n",
      "Epoch 87/100\n",
      " - 0s - loss: 0.1321\n",
      "Epoch 88/100\n",
      " - 0s - loss: 0.1366\n",
      "Epoch 89/100\n",
      " - 0s - loss: 0.1317\n",
      "Epoch 90/100\n",
      " - 0s - loss: 0.1397\n",
      "Epoch 91/100\n",
      " - 0s - loss: 0.1290\n",
      "Epoch 92/100\n",
      " - 0s - loss: 0.1181\n",
      "Epoch 93/100\n",
      " - 0s - loss: 0.1194\n",
      "Epoch 94/100\n",
      " - 0s - loss: 0.1195\n",
      "Epoch 95/100\n",
      " - 0s - loss: 0.1158\n",
      "Epoch 96/100\n",
      " - 0s - loss: 0.1123\n",
      "Epoch 97/100\n",
      " - 0s - loss: 0.1104\n",
      "Epoch 98/100\n",
      " - 0s - loss: 0.1092\n",
      "Epoch 99/100\n",
      " - 0s - loss: 0.1105\n",
      "Epoch 100/100\n",
      " - 0s - loss: 0.1039\n",
      "DATA 目录已存在\n"
     ]
    }
   ],
   "source": [
    "# create and fit the LSTM network\n",
    "model = Sequential()\n",
    "# model.add(LSTM(4, input_shape=(None,1)))\n",
    "model.add(LSTM(32, input_shape=(train_x.shape[1], train_x.shape[2])))\n",
    "# model.add(LSTM(8, input_dim=4, input_length=1, return_sequences=True))\n",
    "# model.add(LSTM(256, return_sequences=False)) \n",
    "model.add(Dense(1))\n",
    "model.compile(loss='mean_squared_error',metrics=['accuracy'],optimizer='adam')\n",
    "model.fit(train_x, train_y, epochs=100, batch_size=1, verbose=2)\n",
    "# model = Sequential()\n",
    "# model.add(LSTM(50, input_shape=(train_X.shape[1], train_X.shape[2])))\n",
    "# model.add(Dense(1))\n",
    "mkpath=\"DATA\" #保存模型的路径\n",
    "mkdir(mkpath)#创造文件夹\n",
    "model.save(os.path.join(\"DATA\",\"Test\" + \".h5\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[[0.]\n",
      "  [1.]\n",
      "  [2.]\n",
      "  [3.]]\n",
      "\n",
      " [[1.]\n",
      "  [2.]\n",
      "  [3.]\n",
      "  [4.]]\n",
      "\n",
      " [[2.]\n",
      "  [3.]\n",
      "  [4.]\n",
      "  [5.]]\n",
      "\n",
      " [[3.]\n",
      "  [4.]\n",
      "  [5.]\n",
      "  [6.]]\n",
      "\n",
      " [[4.]\n",
      "  [5.]\n",
      "  [6.]\n",
      "  [7.]]\n",
      "\n",
      " [[5.]\n",
      "  [6.]\n",
      "  [7.]\n",
      "  [8.]]]\n",
      "===================\n",
      "[[0.]\n",
      " [1.]\n",
      " [2.]\n",
      " [3.]]\n",
      "==========\n",
      "[[3.5620372]]\n",
      "==========\n",
      "[[3.5620372]\n",
      " [5.1487193]\n",
      " [6.3281455]\n",
      " [7.2256184]\n",
      " [7.9346256]\n",
      " [8.514245 ]]\n",
      "6/6 [==============================] - 0s 13ms/step\n"
     ]
    },
    {
     "ename": "TypeError",
     "evalue": "cannot unpack non-iterable numpy.float64 object",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_16688\\1544842837.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m     11\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     12\u001b[0m \u001b[1;31m# 评估模型,不输出预测结果\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 13\u001b[1;33m \u001b[0mloss\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0maccuracy\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mevaluate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtrain_x\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mtrain_y\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;31m#(X_test,Y_test)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     14\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'\\ntest loss'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mloss\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     15\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'accuracy'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0maccuracy\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: cannot unpack non-iterable numpy.float64 object"
     ]
    }
   ],
   "source": [
    "print(train_x)\n",
    "print(\"===================\")\n",
    "print(train_x[0])\n",
    "predict_x = train_x[0].reshape(1, train_x.shape[1], 1)#shape=(1,seq_length,dim) sample=1 很好理解\n",
    "y_train_pred_nn = model.predict(predict_x)\n",
    "print(\"==========\")\n",
    "print(y_train_pred_nn)\n",
    "y_train_pred_all = model.predict(train_x)#预测序列\n",
    "print(\"==========\")\n",
    "print(y_train_pred_all)\n",
    "\n",
    "# 评估模型,不输出预测结果\n",
    "loss,accuracy = model.evaluate(train_x,train_y)#(X_test,Y_test)\n",
    "print('\\ntest loss',loss)\n",
    "print('accuracy',accuracy)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAiCElEQVR4nO3dd3hUVeLG8e9JLyShJQgJGJQuLRCKoKyK7IqK2FZBYQULKhZs60/XXd3iVsWVXUVFBWlSFKy4iAW7AkkIvfdOqKGHJOf3xw3IuigTZib3zsz7eR4eMymT98HJy8m555xrrLWIiIh3RbkdQEREfpqKWkTE41TUIiIep6IWEfE4FbWIiMfFBONJa9eubbOzs4Px1CIiYSk/P3+HtTb9ZB8LSlFnZ2eTl5cXjKcWEQlLxph1P/YxTX2IiHicilpExONU1CIiHqeiFhHxOBW1iIjHqahFRDxORS0i4nEqahERfx0uhoVT4Kt/BuXpg7LhRUQk7O3bCss+gKXTYPXnUH4UUrPg3LshOjag30pFLSLiqx0rYOn7TjlvnOO8r0ZD6HwHNLscsjpAVHTAv62KWkTkx5SXw+aC78t5x3Ln/fVy4KLfOuWc3gyMCWoMFbWIyIlKj8CaL51yXvYf2L8VomIg+zzoOAia9oS0rCqNpKIWETm8F1Z85IyaV3wEJfsgrho0utgZNTfuAYnVXYunohaRyFS85fuLgWu+cC4GJqdDy6udcm7YDWIT3E4JqKhFJJIULf9+vnlTxVHMNc+CzndWXAzMDcrFQH+pqEUkfJWXw6b878t55wrn/fXawUW/q7gY2DToFwP95VNRG2PuB24FLLAAGGitPRzMYCIip6X0iDOVcfxi4LaKi4HnQ6fboemlkJbpdspKOWVRG2MygXuBFtbaQ8aYyUAf4LUgZxMR8c3xi4Hvw4qPv78Y2LiHM2pudLGrFwP95evURwyQaIw5CiQBm4MXSUTEB8WbT7gY+GXFxcAMaHXN9xcDY+LdThkQpyxqa+0mY8zTwHrgEDDDWjvjh59njBk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8flWMdV9MYmoJO19nQ32AUqSybOa72FtfaQMWYy8IG19rVAPL9XRtQdgZXW2tXW2hJgItDb5UwAWGu/AHa5neNE1tot1tqCirf3AUuATHdTOaxjf8XD2Io/ro8GjDFZwGXAK25nCQXGmDSgG/AqgLW2xEslXaE7sMrtkj5BDJBojIkBkoDNgXpirxR1JrDhhMcb8UjxeJ0xJhvIAWa5HOW4iimGQmA78JG11gvZngUeBspP8XlusMAMY0y+MWaQ22EqNASKgFEV00WvGGOS3Q71A32ACW6HALDWbgKeBtYDW4C91toZgXp+rxS1nAZjTDVgCnCftbbY7TzHWGvLrLVtgSygozHG1SkjY8zlwHZrbb6bOX7CedbadkBP4K6K6Ta3xQDtgBestTnAAcBL147igCuAN9zOAmCMqYEzC9AQqAckG2P6Ber5vVLUm4D6JzzOqnif/IiK+d8pwHhr7VS385xMxa/KM4FLXI7SFbiiYi54InCRMWacu5G+VzEaw1q7HXgLZyrQbRuBjSf8NvQmTnF7RU+gwFq7ze0gFS4G1lhri6y1R4GpQJdAPblXinoO0NgY07DiX8o+wLsuZ/Ksigt2rwJLrLXPuJ3nRMaYdGNM9Yq3E3EuEC91M5O19lFrbZa1NhvntfWptTZgox1/GGOSKy4IUzG18HPA9RVG1tqtwAZjTNOKd3UHXL9YfYK+eGTao8J6oLMxJqni57M7zrWjgIgJ1BP5w1pbaoy5G/gQiAZGWmsXuRwLAGPMBOACoLYxZiPwhLX2VXdT0RXoDyyomAsG+I219gP3Ih1XFxhdcUU+CphsrfXUcjiPqQO85fxsEwO8bq2d7m6k4+4BxlcMnlYDA13OAxz/B60HcLvbWY6x1s4yxrwJFAClwFwCuJ3cE8vzRETkx3ll6kNERH6EilpExONU1CIiHqeiFhHxOBW1iIjHqahFRDxORS0i4nH/D9ZJ+y3GvtsaAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from matplotlib import pyplot as plt\n",
    "from numpy import linspace, sin, pi, power, ceil, log2, arange, random\n",
    "\n",
    "plt.figure()\n",
    "a = [1,2,3,4,5,6,7,8]\n",
    "\n",
    "noise2 = random.normal(0, 1, 6)\n",
    "plt.plot(noise2)\n",
    "plt.plot(a[2:],y_train_pred_all)\n",
    "# plt.grid()\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "ea70d47c1026074199160e48050b9f1be75d4ba7d6f2081b88238ca77789226b"
  },
  "kernelspec": {
   "display_name": "Python 3.7.11 ('pytorch-gpu')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.11"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
